//
// Created by hjie on 23-7-16.
//

#pragma once
#include <string>
#include <cstring>
#include <set>
#include <memory>
#include <functional>
#include <map>
#include "user_association.h"

class DataManager;

class UserAssociationManager
{
public:
    UserAssociationManager(DataManager * data_manager);
    ~UserAssociationManager();
public:
    bool AddPublishTarget(const std::string & user_id, const std::string & target_user_id);
    bool AddSubscribe(const std::string & user_id, const std::string & target_user_id);
    bool PublishStream(const std::string & user_id, bool publish);

    std::shared_ptr<UserAssociation> FindUserAssociation(const std::string & user_id);
    bool RemoveData(const std::string & user_id);
private:
    DataManager * m_data_manager;
public:
    std::map<std::string, std::shared_ptr<UserAssociation>> m_user_association_map;
};

